{
GtkStyleContext *context;
GtkStateFlags state;
+ GdkWindow *window;
context = gtk_widget_get_style_context (widget);
state = gtk_style_context_get_state (context);
if (window_border != NULL)
{
- gtk_style_context_save (context);
- gtk_style_context_add_class (context, "window-border");
- gtk_style_context_get_border (context, state, window_border);
- gtk_style_context_restore (context);
+ window = gtk_widget_get_window (widget);
+ if (window != NULL && (gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED) != 0)
+ {
+ GtkBorder empty = { 0 };
+ *window_border = empty;
+ }
+ else
+ {
+ gtk_style_context_save (context);
+ gtk_style_context_add_class (context, "window-border");
+ gtk_style_context_get_border (context, state, window_border);
+ gtk_style_context_restore (context);
+ }
}
}
if (priv->client_decorated &&
priv->decorated &&
- !priv->fullscreen)
+ !priv->fullscreen &&
+ !(gdk_window_get_state (gtk_widget_get_window (widget)) & GDK_WINDOW_STATE_MAXIMIZED))
{
gtk_style_context_add_class (context, "window-border");
gtk_widget_get_allocation (widget, &allocation);